package com.voja.mrvica2;

import java.io.InputStream;
import android.content.Context;

public class Entry {
    public static final int LOADING_ID = -1;
    
	private int         id          = 0;
	private String      title       = "";
	private String      image       = "";
	private String      link        = "";
	private String      description = "";
	private InputStream input       = null;
	
	public int    getId()               { return this.id; }
	public String getTitle()            { return this.title; }
	public String getImage()            { return this.image; }
	public String getLink()             { return this.link; }
	public String getDescription()      { return this.description; }
	public InputStream getInputStream() { return this.input; }
	
	public void setId(int id)                      { this.id          = id; }
	public void setTitle(String title)             { this.title       = title; }
	public void setImage(String image)             { this.image       = image; }
	public void setLink(String link)               { this.link        = link; }
	public void setDescription(String description) { this.description = description; }
	public void setInput(InputStream input)        { this.input       = input; }
	
	public void set(int id, String title, String image, String link, String description) {
		this.id 		 = id;
		this.title 		 = title;
		this.image 		 = image;
		this.link 		 = link;
		this.description = description;
	}
	
	public void setLoading(Context context) {
		String title = context.getResources().getString(R.string.loading);
		this.set(LOADING_ID, title, "", "", "");
	}
	
	public boolean isLoading() {
	    return getId() == LOADING_ID;
	}
	
};
